

package cn.signalpha.modules.schedule.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * 定时任务
 *
 * @author Mark sunlightcs@gmail.com
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("schedule_job")
@ApiModel(value = "ScheduleJob对象", description = "定时任务")
public class ScheduleJob implements Serializable {

	private static final long serialVersionUID = 1L;

	/**
	 * 任务调度参数key
	 */
    public static final String JOB_PARAM_KEY = "JOB_PARAM_KEY";

	/**
	 * 任务id
	 */
	@TableId(value = "job_id", type = IdType.AUTO)
	@ApiModelProperty(value = "任务id")
	private Integer jobId;

	/**
	 * spring bean名称
	 */
	@ApiModelProperty(value = "bean名称")
	@NotBlank(message="bean名称不能为空")
	private String beanName;

	/**
	 * 参数
	 */
	@ApiModelProperty(value = "参数")
	private String params;

	/**
	 * cron表达式
	 */
	@ApiModelProperty(value = "cron表达式")
	@NotBlank(message="cron表达式不能为空")
	private String cronExpression;

	/**
	 * 任务状态
	 */
	@ApiModelProperty(value = "任务状态")
	@NotNull(message="状态不能为空")
	private Integer status;

	/**
	 * 备注
	 */
	@ApiModelProperty(value = "备注")
	private String remark;

	/**
	 * 创建时间
	 */
	@ApiModelProperty(value = "创建时间")
	private Date createTime;

}
